import axios from './axios'

export function getWarehouse() {
  return axios({
    url: '/warehouse/warehouse'
  })
}

export function addWarehouse(params) {
  return axios({
    method: 'post',
    url: '/warehouse/warehouse',
    params
  })
}

export function updateWarehouse(params) {
  return axios({
    method: 'put',
    url: '/warehouse/warehouse',
    params
  })
}

export function delWarehouse(params) {
  return axios({
    method: 'delete',
    url: '/warehouse/warehouse',
    params
  })
}

//仓库库存查询 一维
export function getStock(params = {}) {
  return axios({
    // url:'input-out-save-repertory-one/getInputRepertoryOne',
    url: '/ware-inventory-one-log/warehouseInventoryQueryByOne',
    // url:'/input-out-save-repertory-one/getInputRepertoryOne',
    params
  })
}
//数量总和
export function getSum(params) {
  return axios({
    url: '/ware-inventory-one-log/warehouseInventorySum',
    params
  })
}

//仓库库存查询 二维
export function getTowStock(params = {}) {
  return axios({
    // url:'/ware-inventory-two-log/warehouseInventoryQueryByTwo',
    url: '/ware-inventory-two-log/warehouseInventoryQueryByTwo',
    params
  })
}
//数量总和
export function getSum1(params) {
  return axios({
    url: '/ware-inventory-two-log/warehouseInventoryQuerySum',
    params
  })
}

//货品畅销查询
export function getBestS(params) {
  return axios({
    // method:'post',
    // url:'/input-out-save-repertory-one/goodsSellingRankingQuery',
    // url:'/ware-inventory-one-log/goodsSellingRankingQuery', // 后端要求换接口
    url: '/input-out-save-repertory-one/goodsSellingRankingQuery',
    params
  })
}

//仓库盘差新建/改单
export function postNewbuild(data) {
  return axios({
    method: 'post',
    url: '/warehouse-differ/warehouseDiffer',
    data
  })
}

//仓库盘差查询
export function getDifference(params = {}) {
  return axios({
    url: '/warehouse-differ/warehouseDiffer',
    params
  })
}

//货品进销存统计 查询
export function getSSS(data) {
  return axios({
    method: 'post',
    url: '/input-out-save-repertory-one/invoicingStatisticsQuery',
    data
  })
}

//盘差确认
export function confirmDifference(params) {
  return axios({
    method: 'put',
    url: '/warehouse-differ/affirm',
    params
  })
}

// /根据型号数组获取货号id集
export function getKindsNumberId(params) {
  return axios({
    url: '/kinds-number/listByStyleNumber',
    params
  })
}
